package com.lzy.managersystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lzy.managersystem.pojo.Course;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author qq619
 * @description 针对表【course】的数据库操作Mapper
 * @createDate 2022-07-17 11:12:39
 * @Entity com.lzy.managersystem.pojo.Course
 */
public interface CourseMapper extends BaseMapper<Course> {

    //查询所有

    List<Course> selectAll();

    //插入
    int insertSelective(Course course);


    //根据id删除
    int delById(@Param("id") Integer id);

    //更新
    int updateSelective(Course course);


    Page<Course> findPage(Page<Course> page, @Param("name") String name);

    //根据id查询老师的教授课程
    List<Course> findCourseByid(@Param("id") String id);

    //学生选课
    int updateCourse(@Param("courseId") Integer courseId, @Param("studentId") Integer studentId);

    int delCourse(@Param("courseId") Integer courseId, @Param("studentId") Integer studentId);

    //根据id查询学生选课信息
    List<Course> findStuCourse(@Param("id") Integer id);

}




